<template>
  <div class="finish-item clearfix">
    <div class="finish-top clearfix">
      <div class="finish-ranking">
        <div class="finish-top3-ranking" v-if="ranking<=3">
          <div class="ranking-num">TOP{{ranking}}</div>
          <div class="ranking-img">
            <img v-if="ranking==='1'" src="../assets/medal-1.png" alt="">
            <img v-if="ranking==='2'" src="../assets/medal-2.png" alt="">
            <img v-if="ranking==='3'" src="../assets/medal-3.png" alt="">
          </div>
        </div>
        <div class="finish-other-ranking" v-else>
          {{ranking}}
        </div>
      </div>
      <div class="finish-top-info">
        <div class="finish-img" v-lazy:background-image="img"></div>
        <div class="finish-name">
          <div>
            <h1 class="one-line-ellipsis">{{shortName}}</h1>
            <p class="two-line-ellipsis">{{name}}</p>
          </div>
        </div>
      </div>
    </div>
    <div class="finish-bottom">
      <div class="finish-bottom-item">
        <span class="finish-address icon"></span>
        <span class="content">{{address}}</span>
      </div>
      <div class="finish-bottom-item">
        <span class="finish-site icon"></span>
        <span class="content">公司网址：{{site}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    shortName: {
      type: String,
      default: ''
    },
    name: {
      type: String,
      default: ''
    },
    address: {
      type: String,
      default: ''
    },
    site: {
      type: String,
      default: ''
    },
    ranking: {
      type: String,
      default: ''
    },
    img: {
      type: String,
      default: ''
    },
    itemId: {
      type: String,
      default: ''
    }
  }
}
</script>

<style scoped lang="scss">
.finish-item {
  box-sizing: border-box;
  width: 6.9rem;
  margin: 0 auto 0.3rem auto;
  padding: 0.3rem 0.2rem 0.2rem 0.25rem;
  background: rgba(32, 32, 40, 1);
  box-shadow: 0 0.01rem 0.04rem 0 rgba(131, 131, 131, 0.1);
  border-radius: 0.14rem;
  color: rgba(254, 254, 254, 1);
}
.finish-top {
  width: 100%;
  height: 1.68rem;
  .finish-ranking {
    float: left;
    .finish-top3-ranking {
      text-align: center;
    }
    .ranking-num {
      font-size: 0.24rem;
      font-weight: bold;
      color: rgba(209, 182, 139, 1);
    }
    .ranking-img {
      margin-top: 0.1rem;
      text-align: center;
      img {
        display: inline-block;
        width: 0.53rem;
        height: auto;
      }
    }
    .finish-other-ranking {
      width: 0.48rem;
      height: 0.48rem;
      background: url(../assets/ranking-bg.png) center no-repeat;
      background-size: contain;
      font-size: 0.25rem;
      font-weight: bold;
      color: rgba(185, 173, 115, 1);
      text-align: center;
      line-height: 0.48rem;
      margin-top: 0.46rem;
    }
  }
}
.finish-top-info {
  float: right;
  width: 5.68rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(173, 159, 102, 0.5);
  .finish-img {
    display: inline-block;
    width: 2.23rem;
    height: 1.38rem;
    box-sizing: border-box;
    border: 0.04rem solid rgba(209, 182, 139, 1);
    border-radius: 0.08rem;
    background: #fff center no-repeat;
    background-size: contain;
  }
  .finish-name {
    display: inline-flex;
    width: 3.1rem;
    height: 1.38rem;
    vertical-align: top;
    margin-left: 0.2rem;
    align-items: center;
    div {
      width: 100%;
      h1 {
        font-size: 0.4rem;
        font-weight: 700;
      }
      p {
        margin-top: 0.16rem;
        font-size: 0.26rem;
        line-height: 0.36rem;
      }
    }
  }
}
.finish-bottom {
  float: right;
  width: 5.68rem;
  margin-top: 0.3rem;
  .finish-bottom-item {
    font-size: 0.26rem;
    font-weight: 700;
    line-height: 0.36rem;
    margin-bottom: 0.2rem;
    img {
      display: inline-block;
      vertical-align: -0.02rem;
      height: 0.26rem;
      width: auto;
    }
    .icon {
      float: left;
      width: 0.32rem;
      height: 0.24rem;
      background: center no-repeat;
      background-size: contain;
      margin: 0.04rem;
    }
    .finish-address {
      background-image: url(../assets/address.png);
    }
    .finish-site {
      background-image: url(../assets/site.png);
    }
    .content {
      display: block;
      margin-left: 0.45rem;
      line-height: 0.36rem;
    }
  }
}
.finish-apply-box {
  width: 4.82rem;
  height: 0.52rem;
  line-height: 0.52rem;
  .apply-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: rgba(255, 215, 77, 1);
    border-radius: 0.1rem;
    font-weight: 500;
    color: rgba(84, 87, 74, 1);
    font-size: 0.24rem;
  }
}
</style>
